package org.example.finalsecurities.mapper;

import org.apache.ibatis.annotations.*;
import org.example.finalsecurities.entity.StockAlert;

import java.util.List;

@Mapper
public interface AlertMapper {
    @Select("select title, time from t_stock_alerts ")
    List<StockAlert> selectAll();

    @Insert("insert into t_stock_alerts (title, time, create_time, update_time) values " +
            "(#{title}, #{time}, #{createTime}, #{updateTime})")
    Integer insert(StockAlert stockAlert);

    @Update("update t_stock_alerts set title = #{title}, time = #{time}" +
            " where id = #{id}")
    Integer updateById(StockAlert stockAlert);
    @Select("select title, time from t_stock_alerts where id = #{id}")
    StockAlert selectById(Integer id);
    @Delete("delete from t_stock_alerts")
    Integer delete();
}
